********************************************************************************
****** Replication: Border Barriers and Local Armed Uprisings ******************
****** Security Studies, 2025 **************************************************
****** Md Muhibbur Rahman ******************************************************
****** Cornell University ******************************************************
****** March, 2025 *************************************************************
********************************************************************************

*** Load the data
set more off
use ss_replication_data, clear 
xtset ccode year 


*******************************
*** Tables in the Main Text ***
*******************************


** Table 1: Mixed Effects Models of Border Barrier and Local Armed Conflict

* Model (1)
xtmelogit civ_war i.bw_dummy || ccode: , intpoints(10)

* Model (2)
xtmelogit civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold || ccode: , intpoints(10)

* Model (3)
xtmelogit civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)



** Table 2: Two-Way Fixed Effects Models of Border Barrier and Local Armed Conflict

* Model (4)
xtreg civ_war i.bw_dummy i.year, fe

* Model (5)
xtreg civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.year, fe

* Model (6)
gen lag_treated = L1.bw_dummy
gen lead_treated = F1.bw_dummy

xtreg civ_war i.bw_dummy lag_treated lead_treated riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.year, fe



** Table 3: Models with the interaction between neighboring border barrier and rivalry

*Model (7)
xtmelogit civ_war bw_ave c.neigh_bw_ave##c.riv_ave threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)

*Model (8)
xtlogit civ_war bw_ave c.neigh_bw_ave##c.riv_ave threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold region_SSA region_SoAsia region_MENA region_Latin region_EAsiaPac region_EurCentAsia region_NoAmer, re

*Model (9)
xtreg civ_war bw_ave c.neigh_bw_ave##c.riv_ave threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.year, fe



** Table 4: Border Barriers, External Support, and Domestic Armed Conflict

*Note: The Table is a list of border walls, and other relevant variables including external support and civil conflict. The data compiled from different sources. See the sources listed under the Table.



********************************
*** Tables in the Appendices ***
********************************


*** Load the data
set more off
use ss_replication_data, clear 
xtset ccode year 


** Table A1: Summary Statistics 

estpost sum civ_war bw_dummy bw_extended_KPS bw_count neigh_bw_count lngdppc state_cap_HS riv_dummy threat neighbors_number prev_civ_conf extek  mtnest oilpcl polity2_P4 lnpop 



** Table A2: Mixed Effects Models with Extended Border Barrier Data

*Model (10)
xtmelogit civ_war i.bw_extended_KPS|| ccode: , intpoints(10)

*Model (11)
xtmelogit civ_war i.bw_extended_KPS riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold || ccode: , intpoints(10)

*Model (12)
xtmelogit civ_war i.bw_extended_KPS riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)



** Table A3: Additional Models with the Total Number of Border Barriers as IV

*Model (13)
xtmelogit civ_war bw_count riv_dummy threat neighbors_number neigh_bw_count prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)

*Model (14)
xtlogit civ_war bw_count riv_dummy threat neighbors_number neigh_bw_count prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold region_SSA region_SoAsia region_MENA region_Latin region_EAsiaPac region_EurCentAsia region_NoAmer, re

*Model (15)
xtreg civ_war bw_count riv_dummy threat neighbors_number neigh_bw_count prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.year, fe



** Table A4: Additional Models with the Weighted Measure of Border Barrier as IV

*Model (16)
xtmelogit civ_war bw_ave riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)

*Model (17)
xtlogit civ_war bw_ave riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold region_SSA region_SoAsia region_MENA region_Latin region_EAsiaPac region_EurCentAsia region_NoAmer, re

*Model (18)
xtreg civ_war bw_ave riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.year, fe



** Table A5: Random Effects Logit Models

*Model (19)
xtlogit civ_war i.bw_dummy, re 

*Model (20)
xtlogit civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold, re 

*Model (21)
xtlogit civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold region_SSA region_SoAsia region_MENA region_Latin region_EAsiaPac region_EurCentAsia region_NoAmer, re




** Table A6: Mixed Effects Models with a Time Trend

*Model (22)
xtmelogit civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer year || ccode: , intpoints(10)

*Model (23)
xtlogit civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold region_SSA region_SoAsia region_MENA region_Latin region_EAsiaPac region_EurCentAsia region_NoAmer year, re

*Model (24)
xtreg civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold year, fe




** Table A7: Additional Models Controlling for H&S Measure of State Capacity

*Model (25)
xtmelogit civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop state_cap_HS postcold || ccode: , intpoints(10)

*Model (26)
xtmelogit civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop state_cap_HS postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)

*Model (27)
xtreg civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop state_cap_HS postcold i.year, fe

*Model (28)
xtreg civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop state_cap_HS postcold region_SSA region_SoAsia region_MENA region_Latin region_EAsiaPac region_EurCentAsia region_NoAmer i.year, fe




** Table A8: Additional Models Controlling for Military Capacity

*Model (29)
xtmelogit civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop milexpercap postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)

*Model (30)
xtmelogit civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop milpercap postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)

*Model (31)
xtmelogit civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop paramilcap postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)



** Table A9: Two-Way Fixed Effects Models – Adding Key Covariates

*Model (32)
xtreg civ_war i.bw_dummy riv_dummy i.year, fe

*Model (33)
xtreg civ_war i.bw_dummy riv_dummy threat i.year, fe

*Model (34)
xtreg civ_war i.bw_dummy riv_dummy threat neighbors_number i.year, fe

*Model (35)
xtreg civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf i.year, fe

*Model (36)
xtreg civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek i.year, fe


** Table A10: Two-Way Fixed Effects Models – Adding Key Covariates (Continued)

*Model (37)
xtreg civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek oilpcl i.year, fe

*Model (38)
xtreg civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek oilpcl polity2_P4 i.year, fe

*Model (39)
xtreg civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop i.year, fe

*Model (40)
xtreg civ_war i.bw_dummy riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc i.year, fe



** Table A11: Additional Models – Neighboring Border Barrier as IV

*Model (41)
xtmelogit civ_war bw_ave neigh_bw_ave riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)

*Model (42)
xtlogit civ_war bw_ave neigh_bw_ave riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold region_SSA region_SoAsia region_MENA region_Latin region_EAsiaPac region_EurCentAsia region_NoAmer, re

*Model (43)
xtreg civ_war bw_ave neigh_bw_ave riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.year, fe



** Table A12: Additional Models – All Border Barriers (Including Neighboring Barriers) as IV

*Model (44)
xtmelogit civ_war bw_all_cat riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)

*Model (45)
xtlogit civ_war bw_all_cat riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold region_SSA region_SoAsia region_MENA region_Latin region_EAsiaPac region_EurCentAsia region_NoAmer, re

*Model (46)
xtreg civ_war bw_all_cat riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop lngdppc postcold i.year, fe




** Table A13: Additional Models – Interactions between Border Barrier and State Capacity


*Model (47)
xtmelogit civ_war i.bw_dummy##c.state_cap_HS riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)

*Model (48)
xtmelogit civ_war i.bw_dummy##c.lngdppc riv_dummy threat neighbors_number prev_civ_conf extek mtnest oilpcl polity2_P4 lnpop postcold i.region_SSA i.region_SoAsia i.region_MENA i.region_Latin i.region_EAsiaPac i.region_EurCentAsia i.region_NoAmer || ccode: , intpoints(10)



